package cn.sirun.com.fca.personal.center.view.impl;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tencent.cloud.iov.common.flow.view.impl.BaseLoadingFlowView;
import com.tencent.cloud.iov.flow.presenter.IPresenter;
import com.tencent.cloud.iov.flow.view.IContentViewContainer;
import com.tencent.cloud.iov.router.Router;
import com.tencent.cloud.iov.util.ActivityUtils;
import com.tencent.cloud.iov.util.ResourcesUtils;
import com.tencent.cloud.uikit.utils.SystemUiUtils;

import cn.sirun.com.fca.personal.center.R;
import cn.sirun.com.fca.personal.center.constant.PersonalCenterActivityConst;

public class AboutVersionFlowView extends BaseLoadingFlowView {

    private TextView mVersionTV, mHotLineTV, mNewVersionTV, mVersionTV2, mVersionProtrolTV;
    private LinearLayout mHotLineLL, mVersionLL;

    public AboutVersionFlowView(Activity activity) {
        super(activity);
    }

    public AboutVersionFlowView(Activity activity, IContentViewContainer container) {
        super(activity, container);
    }

    @Override
    protected IPresenter createPresenter() {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        setUpActionBar();
        initView();
    }

    private void setUpActionBar() {
        final Activity activity = getActivity();
        SystemUiUtils.showActionBar(
                activity, ResourcesUtils.getString(R.string.about),
                ResourcesUtils.getDrawable(R.color.white));
    }

    private void initView() {
        setContentView(R.layout.about_version_activity);
        final Activity activity = getActivity();
        mVersionTV = activity.findViewById(R.id.tv_version);
        mHotLineTV = activity.findViewById(R.id.tv_hot_line_value);
        mNewVersionTV = activity.findViewById(R.id.tv_new_verson_value);
        mVersionTV2 = activity.findViewById(R.id.tv_verson_value);
        mVersionProtrolTV = activity.findViewById(R.id.tv_version_protrol);

        mHotLineLL = activity.findViewById(R.id.ll_hot_line);
        mVersionLL = activity.findViewById(R.id.ll_about);

        mVersionLL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String path = PersonalCenterActivityConst.Path.VERSION_INTRODUCE;
                Intent intent = Router.fromPath(path);
                ActivityUtils.startActivityForResult(getActivity(), intent);
            }
        });

    }
}
